import { watch } from 'vue'
import store from '@/store'
import i18n from '@/i18n'

export function watchLangChange(...cbs) {
  watch(
    () => store.getters.language,
    () => {
      console.log('...cbs: ', cbs)
      cbs.forEach(cb => cb(store.getters.language))
    }
  )
}
export function generateTitle(title) {
  return i18n.global.t('route.' + title)
}